Skip to content

feat(sdk): to-do card builders + NIP-TC spec - #4929

Closed
mcdickenson wants to merge 2 commits into
block:mainfrom
mcdickenson:feature/todo-card-sdk
Closed

feat(sdk): to-do card builders + NIP-TC spec#4929
mcdickenson wants to merge 2 commits into
block:mainfrom
mcdickenson:feature/todo-card-sdk

Conversation

@mcdickenson

@mcdickenson mcdickenson commented Aug 5, 2026

Copy link
Copy Markdown

Note

Stacked on #4924 (feature/todo-card-response-kind, relay kind:40009 support). This branch includes that commit; the diff shown here vs main contains both until #4924 merges. Only the top commit (329d47e) is new in this PR.

What

  • crates/buzz-sdk/src/builders.rsbuild_todo_card_message: builds an ordinary stream message whose content carries the fenced ```buzz:todo-card v1 JSON payload (title + 1..=20 items, optional per-item assignee), adding one p tag per distinct assignee so existing mention delivery notifies them. build_card_response: builds a user-signed kind:40009 check-off event ({"done":bool} content; h/e/item tags).
  • crates/buzz-sdk/src/lib.rs — exports the new builders.
  • docs/nips/NIP-TC.md — the To-Do Cards spec: v1 payload schema and constraints, kind:40009 response tag shape, deterministic client-side state fold (latest-per-pubkey, assignee-authoritative), relay processing (no new storage/read model; responses excluded from timeline/unread/mention kind sets by construction), and security considerations.

Why

v1 cards are authored by agents and CLI tooling via these builders; humans interact by checking items. Pinning the schema and fold semantics in a NIP keeps the desktop renderer, the SDK, and the relay change (#4924) agreeing on one contract.

Test evidence (run on this branch at 329d47e)

  • cargo test -p buzz-sdk: 256 pass, 0 fail (includes 4 new builder tests)
  • Pre-push suite (rust-tests across crates + branch-skew + desktop-tauri-checks): green

Stack

  1. feat(relay): add kind:40009 interactive-card response events #4924 — relay: accept kind:40009 interactive-card responses (base of this branch)
  2. this PR — SDK builders + NIP-TC spec
  3. feat(desktop): interactive to-do card rendering + kind:40009 check-off responses #4928 (feature/todo-card-desktop) — desktop rendering + check-offs; depends on the relay kind at runtime only, so it targets main independently.

🤖 Generated with Claude Code

mcdickenson and others added 2 commits August 5, 2026 13:41
Registers KIND_CARD_RESPONSE (40009) so clients can publish signed
check-off responses to interactive card messages (e tag → card event,
item tag → item id). Channel-scoped like other stream-message kinds:
requires an h tag, MessagesWrite scope, and channel membership via the
generic ingest pipeline. Card state stays a client-side fold — the
relay stores raw events only, and feed/unread queries are unaffected
because they use explicit kind inclusion lists.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Dickenson <mdickenson@squareup.com>
Adds build_todo_card_message (fenced buzz:todo-card v1 payload with
per-assignee p-tags) and build_card_response (kind:40009 check-off),
plus docs/nips/NIP-TC.md pinning the v1 JSON schema, response tag
shape, and client-side fold semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Dickenson <mdickenson@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant